package com.lagou.k8s.service;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.lagou.k8s.dao.DemoDao;
import com.lagou.k8s.pojo.Demo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@JsonIgnoreProperties({"hibernateLazyInitializer", "handler", "fieldHandler"})
@Service
public class DemoService {

    @Resource
    private DemoDao demoDao;

    public void save(Demo demo) {
        demoDao.save(demo);
    }

    public void update(Demo demo) {
        demoDao.save(demo);
    }

    public void delete(Long id) {
        demoDao.deleteById(id);
    }

    public Demo get(Long id) {
        return demoDao.getOne(id);
    }


}
